/*
 * Copyright 2009 Eat Local Food, LLC
 * Copyright (c) 2007 osCommerce (this file was written after
 * code review of osCommerce).
 *
 * This file is part of gwtCommerce.
 *
 * gwtCommerce is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * gwtCommerce is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with gwtCommerce.  If not, see <http://www.gnu.org/licenses/>.
 */
package com.elf.gwt.common.client.model;

import com.google.gwt.json.client.JSONObject;

/**
 *  
 */
public class OrderMetaModel extends AbstractModel
{
	
	protected boolean displayCompany;
	protected boolean displayState;
	protected boolean displaySuburb;
	protected boolean downloadEnabled;
	protected int downloadMaxDays;
	protected int downloadMaxCount;
	protected int doNotEditStatusId;

	public OrderMetaModel()
	{
		displayCompany = true;
		displayState = true;
		displaySuburb = true;
		downloadEnabled = true;
	}
	
	public OrderMetaModel(JSONObject jsonObject)
	{
		displayCompany = convertToBoolean(jsonObject,"display_company");
		displayState = convertToBoolean(jsonObject,"display_state");
		displaySuburb = convertToBoolean(jsonObject,"display_suburb");
		downloadEnabled = convertToBoolean(jsonObject,"download_enabled");
		downloadMaxDays = convertToInteger(jsonObject,"download_maxdays");
		downloadMaxCount = convertToInteger(jsonObject,"download_maxcount");
		doNotEditStatusId = convertToInteger(jsonObject, "do_not_edit_status_id");
	}

	public boolean isDisplayCompany() {
		return displayCompany;
	}

	public boolean isDisplayState() {
		return displayState;
	}

	public boolean isDisplaySuburb() {
		return displaySuburb;
	}
	
	public boolean getDownloadEnabled() {
		return downloadEnabled;
}
	
	public int getDownloadMaxDays() {
		return downloadMaxDays;
	}
	
	public int getDownloadMaxCount() {
		return downloadMaxCount;
	}

	public int getDoNotEditStatusId() {
		return doNotEditStatusId;
	}
}
